release: PLAN04 plugin repo persistence#26
Open
takemi-ohama wants to merge 2 commits into
Open
Conversation
7 tasks
* chore: PLAN04-repos-core Draft PR 作成
* feat(plugin): repos/ 永続クローン + 直接リンク install (PLAN04-repos-core)
plugins/ 中間層を廃止し、repos/ に git clone を永続保持して
projects/ からシンボリックリンクで直接参照する構造に変更。
- models.py: RegisteredRepository に local_path フィールド追加
- registry.py: get_repos_dir() 追加
- repo_manager.py: repos/ 永続クローン、git pull refresh、dirty check 付き remove
- installer.py: repos/ ベースのシンボリックリンク install、repos/ 保護 uninstall、
copy_plugin / _sync_dir 等のコピー系ロジック削除
- syncer.py: InstalledPlugin.path ベース走査、同名衝突時の .<owner> suffix リンク
- updater.py: git pull ベース update
- cli.py: repo remove に --force オプション追加
- .gitignore: repos/ 追加
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(plugin): サブディレクトリ配置・dirty検知・suffix衝突の3件修正
- installer.py / updater.py: rel_path を plugin名ではなく
plugin_path.relative_to(devbase_root) で算出し、
registry.yml の path が name と異なるサブディレクトリ配置に対応
- repo_manager.py: upstream未設定時に @{u}..HEAD が失敗して
dirty=false となりデータ損失の恐れがあった問題を修正。
upstream未設定時は dirty 扱いにして安全側に倒す
- syncer.py: collision suffix を owner のみ → owner--repo に変更し、
同一 owner の複数 repo で同名 project が衝突する問題を修正。
既存 symlink 存在チェックも追加
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(plugin): pull前スナップショット・repo全体更新・clone失敗クリーンアップ
- updater: git pull 前に旧 plugin の projects をスナップショットし、
pull 後の migration で旧ディレクトリが消えても移行先を検出可能に
- updater: name 指定の update でも同一 repo の全 installed plugin の
metadata (version/path) を pull 後に再読み込みして整合性を維持
- repo_manager: repo add で clone 後の registry.yml parse や名前衝突
失敗時に clone_dir を自動削除し、リトライ時の詰まりを防止
- syncer: path.split('/') を Path().parts に変更 (OS 非依存化)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(plugin): round 3 レビュー指摘対応 — 直接 install の自動 repo 登録 + cleanup
- installer.py: user/repo:plugin-name 形式で未登録リポジトリを指定した際に
自動で repo add を実行し、既存の直接指定形式を維持 (codex round 3 major)
- updater.py: _update_repo_plugins の未使用引数 repo_local_path を削除 (gemini round 3 minor)
- repo_manager.py: git_clone を try/except ブロック内に移動し、
部分 clone 失敗時もディレクトリを自動クリーンアップ (gemini round 3 minor)
全 210 テスト PASSED
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(plugin): round 4 レビュー指摘対応 — @ref 拒否・refresh メタデータ同期・pull エラー改善
- installer.py: 未登録リポジトリの自動登録時に @ref を明示的に拒否
(永続 clone はデフォルトブランチを追跡するため、pinned ref と矛盾する)
- repo_manager.py: refresh_repository で git pull 後に installed plugin の
metadata (version/path) を再計算し sync_projects() を実行
- repo_manager.py: _git_pull で upstream tracking branch の有無を事前検査し、
未設定時に具体的な修正手順を含むエラーメッセージを返す
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(plugin): round 5 レビュー指摘対応 — NameError修正・エラーメッセージ改善・レガシーrepo移行・batch refresh効率化
- installer.py:131 — @ref 拒否時の未定義変数 `url` を `repo_url` に修正 (NameError 解消)
- repo_manager.py:133 — _git_pull の upstream 未設定エラーで detached HEAD/remote未設定を個別判定、remote名を動的取得
- repo_manager.py:379 — refresh_repository に sync パラメータ追加、batch refresh 時は最後に1回だけ sync_projects 実行
- installer.py:223 — legacy repo (local_path 未設定) の自動移行: 初回 install 時に永続 clone を作成して local_path を設定
- テスト追加: @ref 拒否の PluginError テスト、legacy repo migration テスト (計 212 tests PASSED)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(plugin): レガシー移行時の整合性修正 + UX改善 (round 6 review)
- installer.py: レガシーrepo移行時に parse_registry_yml で検証してから
plugins.yml へ保存するように変更。plugins リストも registry.yml から
最新情報を取得して更新 (major x2 対応)
- repo_manager.py: 複数リモート時に origin を優先選択 (minor)
- repo_manager.py: detached HEAD エラーに具体的な復帰コマンド例を追加 (minor)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(plugin): print→logger 統一 + SSH/HTTPS URL 重複登録検知 (deferred nit)
- installer.py: _install_from_repo 内の print() を logger.info() に統一
- repo_manager.py: add_repository で SSH/HTTPS 形式の URL バリアント重複を
_url_to_repos_dirname 正規化により検知し、RepositoryError で拒否
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(plugin): round 1 レビュー指摘対応 — @ref拒否・host付きdirname・refresh snapshot・print→logger・migration テスト
- 登録済みrepoへの @ref 指定を PluginError で拒否(codex + gemini 指摘)
- _url_to_repos_dirname に host を含め、異なるホストの同名 repo の衝突を防止
- refresh_repository で git pull 前に _snapshot_plugin_projects を取得し
_update_repo_plugins に渡すことで、pull 後のディレクトリ変更時も移行可能に
- repo_manager.py の残存 print() を logger.info() に統一
- _migrate_removed_plugin / _snapshot_plugin_projects のテスト追加(3件)
- refresh の pre_pull_projects 受け渡し検証テスト追加
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
個別 PR
Test plan (結合観点のみ)
repo add→plugin install→projects/リンク →devbase upの E2E 動作